package com.etoak.service.impl;

import com.etoak.bean.User;
import com.etoak.mapper.UserMapper;
import com.etoak.service.UserService;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author : 15081
 * @DATE : 2022-12-30 11:03
 **/
@Service   // @Controller @Repository @Component  作用一样 都是实例化对象
public class UserServiceImpl  implements UserService {

    @Resource // 自动注入
    private UserMapper mapper;

    @Override
    public User queryUser(User user) {
        return mapper.queryUser(user);
    }

    @Override
    public int add(User user) {
        return mapper.add(user);
    }

    @Override
    public User selectByUserName(String username) {
        return mapper.selectByUserName(username);
    }

    @Override
    public User selectByEmail(String email) {
        return mapper.selectByEmail(email);
    }
}
